angular.module('app.filter', [])
    /*设备状态*/
    .filter('onlinesta', function () {
        return function (onlinestanum) {
            if (onlinestanum == 1) return "在线";
            else if (onlinestanum == 0) return "离线";
            else return "未知状态";
        }
    })
    /*液晶背光*/
    .filter('devlcdlight', function () {
        return function (lcdlightnum) {
            if (lcdlightnum == 0) return "开";
            else if (lcdlightnum == 1) return "关";
            else return "未知状态";
        }
    })
    /*设备类型*/
    .filter('devtype', function () {
        return function (devtypenum) {
            if (devtypenum == 0x01) return "7寸彩屏的电子价牌";
            else if (devtypenum == 0x02) return "A4单色屏的电子价牌";
            else if (devtypenum == 0x03) return "3.2寸彩屏的电子价牌";
            else if (devtypenum == 0x40) return "UDPServer服务器设备类型";
            else if (devtypenum == 0x41) return "网络中继";
            else return "未知设备";
        }
    })
    /*硬件版本*/
    .filter('hardver', function () {
        return function (hardvernum) {
            var hardver ="V" +(hardvernum>>16)&0xff+"."+(hardvernum>>8)&0xff+"."+(hardvernum)&0xff;
            return hardver;
        }
    })
    /*软件版本*/
    .filter('softver', function () {
        return function (softvernum) {
            var softver ="V" +(softvernum>>16)&0xff+"."+(softvernum>>8)&0xff+"."+(softvernum)&0xff;
            return softver;
        }
    })
    /*存货量*/
    .filter('goodsnumlev', function () {
    return function (numlevnum) {
        if (numlevnum == 0) return "缺货";
        else if (numlevnum == 1) return "余量";
        else if (numlevnum == 2) return "少量";
        else if (numlevnum == 3) return "充足";
        else return "未知状态";
    }
})
;